package com.sakura.gateway.config;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import com.sakura.gateway.props.JwtProperties;
import com.sakura.gateway.utils.JwtUtil;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;


@Slf4j
@Configuration(proxyBeanMethods = false)
@AllArgsConstructor
@EnableConfigurationProperties({JwtProperties.class})
public class JwtConfiguration implements SmartInitializingSingleton {

	private final JwtProperties jwtproperties;

	@Override
	public void afterSingletonsInstantiated() {
		JwtUtil.setJwtProperties(jwtproperties);
	}
}
